package com.blackcat.v2.demo;

import java.util.EventObject;

/**
 * 监听事件
 */
public class MyLifecycleEvent extends EventObject {
    /**
     * Constructs a prototypical Event.
     *
     * @param source The object on which the Event initially occurred.
     * @throws IllegalArgumentException if source is null.
     */
    public MyLifecycleEvent(Object source) {
        super(source);
    }

    /**
     * 触发该事件的具体实例对象
     */
    private MyLifecycle lifecycle ;

    /**
     * 事件类型（对应于Lifecycle中定义的几种状态）
     */
    private String type ;

    /**
     * 该事件携带的参数数据
     */
    private Object data ;


    public MyLifecycleEvent(MyLifecycle lifecycle, String type, Object data) {
        super(data);
        this.lifecycle = lifecycle;
        this.type = type;
        this.data = data;
    }

    public MyLifecycle getLifecycle() {
        return lifecycle;
    }

    public void setLifecycle(MyLifecycle lifecycle) {
        this.lifecycle = lifecycle;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

}
